Home Automation with Intel Galileo by 2015
Author:2015
Language: eng
Format: epub
Publisher: Packt Publishing
Let's parse the received message. The first byte is 0x1, which is the start of the message. 0x9 is the length of the rest. The Node ID is the sixth byte, which is the lamp holder node ID. The next byte is 0x3, which shows the length of the command. If the 0x25 command class is received, we have 0x3, which means the report from the sensor. Finally, we have the 0xff value to indicate the status of the device, which is on here.
Switching the lamp holder on/off with Intel Galileo
Let's switch off the lamp holder and then check its status. We will execute the function given below. The following message is similar to the one we examined in the previous chapter:
int binary_switch_on_off(int serial_device, uint8_t nodeID, uint8_t on_off, uint8_t callbackID) { int message_length = 12; uint8_t checksum = 0x00; uint8_t message_buffer[] = { SOF, 0x0a, REQUEST, SEND_DATA, nodeID, 0x03, COMMAND_CLASS_SWITCH_BINARY, BINARY_SET, on_off, TRANSMIT_OPTION, callbackID, checksum }; checksum = generate_checksum(message_buffer, message_length); message_buffer[message_length - 1] = checksum; return write_to_serial_device(serial_device, message_buffer, message_length); }
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Sass and Compass in Action by Wynn Netherland Nathan Weizenbaum Chris Eppstein Brandon Mathis(7810)
Grails in Action by Glen Smith Peter Ledbrook(7719)
Azure Containers Explained by Wesley Haakman & Richard Hooper(6856)
Configuring Windows Server Hybrid Advanced Services Exam Ref AZ-801 by Chris Gill(6854)
Running Windows Containers on AWS by Marcio Morales(6379)
Kotlin in Action by Dmitry Jemerov(5092)
Microsoft 365 Identity and Services Exam Guide MS-100 by Aaron Guilmette(5077)
Combating Crime on the Dark Web by Nearchos Nearchou(4652)
Microsoft Cybersecurity Architect Exam Ref SC-100 by Dwayne Natwick(4632)
Management Strategies for the Cloud Revolution: How Cloud Computing Is Transforming Business and Why You Can't Afford to Be Left Behind by Charles Babcock(4438)
The Ruby Workshop by Akshat Paul Peter Philips Dániel Szabó and Cheyne Wallace(4341)
The Age of Surveillance Capitalism by Shoshana Zuboff(3983)
Python for Security and Networking - Third Edition by José Manuel Ortega(3901)
The Ultimate Docker Container Book by Schenker Gabriel N.;(3562)
Learn Wireshark by Lisa Bock(3544)
Learn Windows PowerShell in a Month of Lunches by Don Jones(3530)
Mastering Python for Networking and Security by José Manuel Ortega(3376)
Mastering Azure Security by Mustafa Toroman and Tom Janetscheck(3356)
Blockchain Basics by Daniel Drescher(3327)
